package pl.us.ij.plugins.segmentation.infrastructure;

import ij.ImagePlus;
import ij.process.FloatProcessor;

public class GrayedColorConvertStrategy extends ConvertStrategy {
    public GrayedColorConvertStrategy(ImagePlus imp, CommandParams params) {
        super(imp, params);
    }

    @Override
    public FloatProcessor getFloatProcessor(int channelNo) {
        return (FloatProcessor) inputImage.getProcessor().convertToFloat();
    }

    @Override
    public void setFloatProcessor(int channelNo, FloatProcessor fp) {
        inputImage.getProcessor().setPixels(0, fp);
        inputImage.getProcessor().setPixels(1, fp);
        inputImage.getProcessor().setPixels(2, fp);
    }
}
